<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="终端销售明细">
            <div class="row wrapper-y-sm">
                <div class="search-bar wrapper-none col-xs-12">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search(1)" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                            ng-click="switchToolbar('showColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="isCHY">
                            <div translate translate-attr-title="导出" yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs"
                        ng-click="switchToolbar('showAdvanceSearch')" translate-attr-title="高级搜索" translate="高级搜索more"></button>

                    <div class="input-group pull-right clearfix" ng-if="isCoreCompany">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="代理商名称"
                            ng-model="condition.agentName">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)" translate>搜索</span>
                    </div>
                    <div class="wrapper-none search-bar-data-picker pull-right">
                        <div class="normal-search clearfix">
                            <label class="control-label"><span translate>开始时间</span>：</label>
                            <input type="text" class="form-control date-picker m-r-sm"
                                ng-model="condition.startOutboundTime" datepicker-popup="yyyy-MM-dd"
                                ng-click="switchDataPicker(0)" placeholder="请选择开始时间"
                                ng-change="checkDate(condition, 'startOutboundTime', 'endOutboundTime')"
                                is-open="datePickerFlag[0]" close-text="关闭" readonly>
                            <label class="control-label"><span translate>结束时间</span>：</label>
                            <input type="text" class="form-control date-picker m-r-sm"
                                ng-model="condition.endOutboundTime" datepicker-popup="yyyy-MM-dd"
                                ng-click="switchDataPicker(1)" placeholder="请选择结束时间"
                                ng-change="checkDate(condition, 'startOutboundTime', 'endOutboundTime')"
                                is-open="datePickerFlag[1]" close-text="关闭" readonly>
                        </div>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                    reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix" ng-if="isCoreCompany">
                            <label class="control-label"><span translate>代理商名称</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.agentName" translate translate-attr-placeholder="请输入代理商名称">
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"><span translate>开始时间</span>：</label>
                            <input type="text" class="form-control date-picker" ng-model="condition.startOutboundTime"
                                datepicker-popup="yyyy-MM-dd" ng-click="switchDataPicker(0)" placeholder="请选择开始时间"
                                ng-change="checkDate(condition, 'startOutboundTime', 'endOutboundTime')"
                                is-open="datePickerFlag[0]" close-text="关闭" readonly>
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"></label>
                            <label class="control-label wave-line">~</label>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>结束时间</span>：</label>
                            <input type="text" class="form-control date-picker" ng-model="condition.endOutboundTime"
                                datepicker-popup="yyyy-MM-dd" ng-click="switchDataPicker(1)" placeholder="请选择结束时间"
                                ng-change="checkDate(condition, 'startOutboundTime', 'endOutboundTime')"
                                is-open="datePickerFlag[1]" close-text="关闭" readonly>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>客户名称</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.clientName" translate translate-attr-placeholder="请输入客户名称">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>联系方式</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.contactPhone" translate translate-attr-placeholder="请输入联系方式">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>所属单位</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.shortName" translate translate-attr-placeholder="请输入所属单位">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>客户分类</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.className" translate translate-attr-placeholder="请输入客户分类">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>客户分级</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.dealerLevelName" translate translate-attr-placeholder="请输入客户分级">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>是否大客户</span>：</label>
                            <select class="form-control" ng-model="condition.bigClientFlag">
                                <option value="" translate>请选择</option>
                                <option value="0" translate>否</option>
                                <option value="1" translate>是</option>
                            </select>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>客户状态</span>：</label>
                            <select class="form-control" ng-model="condition.normalFlag">
                                <option value="" translate>请选择</option>
                                <option value="1" translate>正常维护</option>
                                <option value="2" translate>已流失</option>
                            </select>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>车辆编码</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.useMachineNo" translate translate-attr-placeholder="请输入车辆编码">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>保修状态</span>：</label>
                            <select class="form-control" ng-model="condition.warrantyStatus">
                                <option value="" translate>请选择</option>
                                <option value="1" translate>在保</option>
                                <option value="2" translate>出保</option>
                            </select>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>零件编号</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.materialNo" translate translate-attr-placeholder="请输入零件编号">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>零件中文名</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.materialDes" translate translate-attr-placeholder="请输入零件中文名">
                        </div>
                        <div class="advance-search m-t-sm">
                            <div class="form-group clearfix">
                                <label class="control-label"><span translate>零件分类</span>：</label>
                                <div check-box-selector ng-model="checkedNameList" value-list="materialClassList"
                                    box-click="selectMaterialClass()" default-value="请选择分类"
                                    class="col-xs-7 wrapper-none dropdown-prop"></div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>销售渠道</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.salesChannel" translate translate-attr-placeholder="请输入销售渠道">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span translate>结算状态</span>：</label>
                            <select class="form-control" ng-model="condition.checkState">
                                <option value="" translate>请选择</option>
                                <option value="0" translate>未结算</option>
                                <option value="1" translate>部分结算</option>
                                <option value="2" translate>已结算</option>
                            </select>
                        </div>
                        <div class="form-group clearfix" ng-if="isWJ">
                            <label class="control-label"><span translate>是否竞品客户</span>：</label>
                            <select class="form-control" ng-model="condition.isCompetingDealer">
                                <option value="" translate>请选择</option>
                                <option value="0" translate>否</option>
                                <option value="1" translate>是</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tbConf" col-fixed="false"
                has-check-col="true"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tbConf.tableCol track by $index" width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tbConf.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
    </div>
</div>